<?php

namespace App\Models\Inf;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Notifications\Notifiable;

use App\Models\Conf\Site;
use App\Models\Def\MainGamePlat;

class Player extends Model
{
    use Notifiable;

    protected static function boot()
    {
        parent::boot();
    }

    public $table = 'inf_site_players';

    const CREATED_AT = 'created_at';

    const UPDATED_AT = 'updated_at';

    public $fillable = [
        'site_id',
        'username',
        'password',
        'main_game_plats_id',
        'isdemo'
    ];

    protected $casts = [
        'id' => 'integer',
        'site_id' => 'integer',
        'username' => 'string',
        'password' => 'string',
        'main_game_plats_id' => 'integer',
        'isdemo' => 'boolean'
    ];

    public static $rules = [];

    public function site()
    {
        return $this->belongsTo(Site::class, 'site_id', 'id');
    }

    public function MainGamePlat()
    {
        return $this->belongsTo(MainGamePlat::class, 'id', 'main_game_plats_id');
    }

}
